#ifndef DIAGRAMSCENE_H
#define DIAGRAMSCENE_H

#include <QGraphicsScene>
#include <math.h>

#include "movetype.h"
#include "element.h"

#define SCENE_WIDTH 300
#define SCENE_HEIGHT 400
#define SCENE_DIAGONAL sqrt(SCENE_WIDTH*SCENE_WIDTH + SCENE_HEIGHT*SCENE_HEIGHT)
#define SCENE_BORDER 2

class Scene : public QGraphicsScene
{
    Q_OBJECT

public:
    enum ElementType { SquareType, CircleType, NodeType } elementType;
    MoveType moveType;

    Scene();
    Element* createElement(qreal x, qreal y);

public slots:
    void deleteItem();
    void pickSquare();
    void pickCircle();

signals:
    void itemSelected(Element*);
    void circleMoveInsert(Element*);

private:
    void mousePressEvent(QGraphicsSceneMouseEvent*);
    void addElement(Element*, qreal, qreal);
};

#endif // DIAGRAMSCENE_H
